<template>
  <div>

  </div>
</template>
<script>

export default {
    data(){

    },
    methods:{
        getStreamLog(){
            let that = this;
            const toast = this.$createToast({
            txt: '...',
            mask: true
          })
          toast.show();
            let people_id = that.$route.query.people_id;
            if(!people_id){
                that.toast = that.$createToast({
                  txt: "找不到people_id",
                  type: 'txt'
                })
                that.toast.show()
                setTimeout(function(){
                    that.$router.replace("/");
                },2000)
            }
            let url = "/fang/personal/bind_people";
            that.$axios.post(url,that.$qs.stringify({
                    access_token:that.$store.state._token01,
                    people_id:people_id
                }))
            .then(function(response){
                toast.hide();
                if(res.status == 1){
                    const toast = this.$createToast({
                        txt: '绑定成功',
                        type: 'correct'
                    })
                    toast.show()
                    setTimeout(function(){
                        that.$router.replace("/");
                    },2000)
                }else if (res.status == -1) {
                    that.noLogin();
                }else{
                    setTimeout(function(){
                        that.$router.replace("/");
                    },2000)
                }
            })
            .catch(function(error){
                console.log(error);
                // that.toast = that.$createToast({
                //   txt: error.toString(),
                //   type: 'txt'
                // })
                // that.toast.show()
                setTimeout(function(){
                    that.$router.replace("/");
                },2000)
            });
        },
   },
   mounted(){
       this.getStreamLog();
   },
   metaInfo: {
     title: ""
    }
}
</script>
<style scoped>
</style>
